package com.qf.fmall.index.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.fmall.index.entity.IndexImg;
import com.qf.fmall.index.mapper.IndexImgMapper;
import com.qf.fmall.index.service.IIndexImgService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 轮播图 服务实现类
 * </p>
 *
 * @author weijy
 * @since 2024-01-16
 */
@Service
public class IndexImgServiceImpl extends ServiceImpl<IndexImgMapper, IndexImg> implements IIndexImgService {

    @Autowired
    private IndexImgMapper mapper;
    @Override
    public List<IndexImg> getImgList() {

        QueryWrapper<IndexImg> queryWrapper = new QueryWrapper<>();
        // 1. 根据状态值status筛选图片,根据seq列正序排列数据
        queryWrapper.eq("status",1).orderByAsc("seq");
        List<IndexImg> imgList = mapper.selectList(queryWrapper);


        return imgList;
    }
}
